﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentMigrator;
using Media.Migrator.Properties;

namespace MigrationTemplate._1_20._04
{
    [Migration(4)]
    public class m4 : Migration
    {
        public override void Down()
        {
            Create.Table("TvShow_Directories")
                .WithColumn("Id").AsInt32().Identity().PrimaryKey()
                .WithColumn("TypeId").AsInt32().NotNullable()
                .WithColumn("Location").AsCustom("VARCHAR(MAX)").NotNullable();
        }

        public override void Up()
        {
            Delete.Table("TvShow_Directories");

            Create.Table("TvShow_Directories")
                .WithColumn("Id").AsInt32().Identity().PrimaryKey()
                .WithColumn("UserId").AsCustom("VARCHAR(50)").NotNullable()
                .WithColumn("Type").AsCustom("VARCHAR(25)").NotNullable()
                .WithColumn("TypeId").AsInt32().NotNullable()
                .WithColumn("Location").AsCustom("VARCHAR(MAX)").NotNullable()
                .WithColumn("CreatedDate").AsDateTime().NotNullable();

            Delete.Column("FileLocation").FromTable("TvShow_Episodes");
        }
    }
}
